package com.mooc.fuxi.ui.news;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.mooc.fuxi.R;
import com.mooc.fuxi.entity.NewsEntity;
import com.mooc.fuxi.imgload.ImageLoad;

import org.jetbrains.annotations.NotNull;

public class NewsAdapter extends BaseQuickAdapter<NewsEntity.Values, BaseViewHolder> {
    public NewsAdapter() {
        super(R.layout.item_news);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, NewsEntity.Values values) {
        baseViewHolder.setText(R.id.news_title,values.title);
        baseViewHolder.setText(R.id.news_content,values.description);
        ImageView img = baseViewHolder.getView(R.id.news_img);
        ImageLoad.getInstance().loadMatchImg(values.mainimgurl,img);
    }
}
